package com.financing.platform.dao;

import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.financing.platform.dto.OrderByGaiZaoDTO;
import com.financing.platform.dto.OrderDTO;
import com.financing.platform.dto.OrderFlowDTO;
import com.financing.platform.dto.UserInfoDTO;
import com.financing.platform.vo.EmailTemplateUserVO;
import com.financing.platform.vo.OrderActivitiesVO;
import com.financing.platform.vo.OrderEmailVO;
import com.financing.platform.vo.OrderManagerUserVO;
import com.financing.platform.vo.OrderVO;

public interface IOrderDao extends IBaseDao {
	/**
	 * 
	* @Title: queryOrderList 
	* @Description:  查询订单列表
	* @param   orderDTO
	* @return List<OrderDTO>   
	* @throws
	 */
	public List<OrderDTO> queryOrderList(OrderDTO orderDTO );
	
	/**
	 * 
	* @Title: queryOrderList 
	* @Description:  查询订单列表
	* @param   orderDTO
	* @return List<OrderDTO>   
	* @throws
	 */
	public List<HashMap<String,String>> queryOrderByProIdList(OrderVO orderDTO) throws SQLException;
	/**
	 * 
	* @Title: queryOrderList 
	* @Description:  查询订单列表
	* @param   orderDTO
	* @return  
	* @throws
	 */
	public int countOrderByProIdList(OrderVO orderDTO) throws SQLException;
	
	
	/**
	 * 
	 * @Title: queryOrderAllInfoCount
	 * @Description: 查询订单总数 
	 * @param @param orderDTO
	 * @param @return   
	 * @return int   
	 * @throws
	 */
	public int queryOrderAllInfoCount(OrderVO orderVo) throws SQLException;
	
	
	/**
	 * 
	* @Title: queryOrder 
	* @Description: 查询订单详情
	* @param   orderDTO
	* @return OrderDTO   
	* @throws
	 */
	public OrderDTO queryOrder(OrderDTO orderDTO);
	
	/**
	 * @throws SQLException 
	 * 
	* @Title: updateOrder 
	* @Description: 更新订单状态
	* @param   orderDTO
	* @return int   
	* @throws
	 */
	public int updateOrder(OrderDTO orderDTO) throws SQLException;
	/**
	 * @throws SQLException 
	 * 
	* @Title: updateOrder 
	* @Description: 更新订单拉黑状态
	* @param   orderDTO
	* @return int   
	* @throws
	 */
	public int updateOrderDefriendStatus(OrderDTO orderDTO) throws SQLException;
	
	/**
	 * 
	* @Title: queryOrderList 
	* @Description:  查询订单列表
	* @param @param orderVo
	* @return List<OrderVO>   
	* @throws
	 */
	public List<OrderVO> queryOrderList(OrderVO orderVo);
	
	/**
	 * 
	* @Title: orderCancel 
	* @Description: 取消订单
	* @param   orderDTO
	* @return int   
	* @throws
	 */
	public int orderCancel(OrderDTO orderDTO);
	
	/**
	 * 
	* @Title: queryNeedSendSMSFAId 
	* @Description: 产品成立时查询需要发送短信的FA
	* @param   orderDTO
	* @return List<Integer>   
	* @throws
	 */
	public List<String> queryNeedSendSMSFAId(OrderDTO orderDTO);
	
	/**
	 * 
	* @Title: queryOrderFormProjectId
	* @Description: 产品成立获取有效用户id
	* @param   orderDTO
	* @return List<Integer>   
	* @throws
	 */
	public List<Integer> queryOrderFormProjectId(OrderDTO orderDTO) throws Exception;
	
	/**
	 * 
	 * @Title: addOrderFlow
	 * @Description:  添加订单流水 
	 * @param @param orderFlowDTO
	 * @param @return
	 * @param @throws SQLException   
	 * @return int   
	 * @throws
	 */
	public int addOrderFlow(OrderFlowDTO orderFlowDTO) throws SQLException;
	
	/**
	 * 
	* @Title: queryOrderForUserId 
	* @Description: 根据用户id查询订单
	* @param   orderDTO
	* @return List<Integer>   
	* @throws
	 */
	public List<OrderActivitiesVO> queryOrderForUserId(String userId) throws SQLException ;
	
	/**
	 * 
	 * @Title: queryFaOrderPerForEmail
	 * @Description: 查询订单需要发送工作人员的订单 
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<EmailTemplateUserVO>   
	 * @throws
	 */
	public List<EmailTemplateUserVO> queryFaOrderPerForEmail() throws SQLException;
	
	/**
	 * 根据订单ID查询订单和产品信息
	 * @param ids 订单ID，可多个，中间“,”号分割
	 * @return
	 * @throws SQLException
	 */
	public List<OrderDTO> queryInfoByOrderIds(String ids) throws SQLException;
	
	/**
	 * 
	 * @Title: queryneedSendEmailToManager
	 * @Description: 查询发送给管理组的订单 
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryneedSendEmailToManager() throws SQLException;
	
	/**
	 * 
	 * @Title: queryPevcneedSendEmailToManager
	 * @Description: 查询发送给管理组的订单 pevc
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryPevcneedSendEmailToManager() throws SQLException;
	
	/**
	 * 
	 * @Title: queryneedSendEmailToManagerUser
	 * @Description: 查询发送给管理员的订单 
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryneedSendEmailToManagerUser() throws SQLException;
	
	/**
	 * 
	 * @Title: queryPEVCneedSendEmailToManagerUser
	 * @Description: 查询发送给管理员的订单 PEVC
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryPEVCneedSendEmailToManagerUser() throws SQLException;
	
	/**
	 * 
	 * @Title: queryneedSendEmailToManagerUserDetail
	 * @Description: 查询发送给管理员的订单详情 
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryneedSendEmailToManagerUserDetail(UserInfoDTO user) throws SQLException;
	
	/**
	 * 
	 * @Title: queryPevcneedSendEmailToManagerUserDetail
	 * @Description: 查询发送给管理员的订单详情  pevc
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryPevcneedSendEmailToManagerUserDetail(String uid) throws SQLException;
	
	/**
	 * 
	 * @Title: queryneedSendEmailToManagerSM
	 * @Description: 查询发送给管理组的私募订单 
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryneedSendEmailToManagerSM() throws SQLException;
	
	/**
	 * 
	 * @Title: queryneedSendEmailToManagerUserSM
	 * @Description: 查询发送给管理员的私募订单 
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryneedSendEmailToManagerUserSM() throws SQLException;
	
	/**
	 * 
	 * @Title: queryneedSendEmailToManagerUserDetailSM
	 * @Description: 查询发送给管理员的私募订单详情 
	 * @param @return
	 * @param @throws SQLException   
	 * @return List<OrderEmailVO>   
	 * @throws
	 */
	public List<OrderEmailVO> queryneedSendEmailToManagerUserDetailSM(UserInfoDTO user) throws SQLException;

	/**
	 * 根据邀请人，查询订单管理员
	 * @param sourceCode
	 * @return
	 * @throws SQLException
	 */
	public List<String> queryOrderManagerUserBySource(int sourceCode) throws SQLException;

	public int queryOrderFollowUpAllInfoCount(OrderVO orderVo) throws SQLException;

	public List<OrderVO> queryOrderFollowUpList(OrderVO orderVo) throws SQLException;
	/**
	 * 订单流程改造
	 * 综合查询 订单详情
	 * @param orderByGaiZaoDTO
	 * @return
	 * @throws SQLException
	 */
	public List<OrderByGaiZaoDTO> queryOrderByGaiZao(OrderByGaiZaoDTO orderByGaiZaoDTO) throws SQLException;
	
	/**
	 * 订单流程改造
	 * 综合查询 订单详列表
	 * @param orderByGaiZaoDTO
	 * @return
	 * @throws SQLException
	 */
	public List<OrderByGaiZaoDTO> queryOrderListByGaiZao(OrderByGaiZaoDTO orderByGaiZaoDTO) throws SQLException;
	
	/**
	 * 订单流程改造
	 * 综合查询 订单基础信息-单表查询
	 * @param orderByGaiZaoDTO
	 * @return
	 * @throws SQLException
	 */
	public List<OrderByGaiZaoDTO> queryOrderBaseInfoByGaiZao(OrderByGaiZaoDTO orderByGaiZaoDTO) throws SQLException;
	
	/**
	 * 订单流程改造
	 * 综合查询订单条数
	 * @param orderByGaiZaoDTO
	 * @return
	 * @throws SQLException
	 */
	public int queryOrderCountByGaiZao(OrderByGaiZaoDTO orderByGaiZaoDTO) throws SQLException;
	
	/**
	 * 订单流程改造
	 * 综合更新订单
	 * @param orderByGaiZaoDTO
	 * @return
	 * @throws SQLException
	 */
	public int updateOrderByGaiZao(OrderByGaiZaoDTO orderByGaiZaoDTO) throws SQLException;
	/**
	 * 查询订单负责人
	 */
	public List<OrderManagerUserVO> queryOrderOwnerUserList() throws SQLException;

    public  List<OrderFlowDTO> queryOrderFlowList(String orderId) throws SQLException;

	public void updateOrderFlow(OrderFlowDTO orderFlowDTO) throws SQLException;

	public Map<String,Object> queryOrderMaxMinDateByProductId(Integer integer)throws SQLException;

    public BigDecimal getAllAmount(OrderDTO orderDTO)throws SQLException;
  
	public List<String> queryFaUserOrder()throws SQLException;

	//查询订单-昨日我的团队的业绩月度业绩
	public List<Map<String,Object>> queryOrderOwnerUserCountAmount()throws SQLException;

}